// 1.0 导入vue核心包
import Vue from 'vue';

// 2.0 导入App.vue的vue对象
import App from './App.vue';

import VueRouter from 'vue-router';
import Mintui from 'mint-ui';
import 'mint-ui/lib/style.min.css';
import VuePreview from 'vue-preview';
Vue.use(VuePreview);
// 3.0 利用Vue对象进行解析渲染
Vue.use(VueRouter);
Vue.use(Mintui);
import home from '../components/Home.vue';
import shopcar from '../components/shopcar/car.vue';
import newslist from '../components/news/newslist.vue';
import newsinfo from '../components/news/newsinfo.vue';
import photolist from '../components/photo/photolist.vue';
import photoinfo from '../components/photo/photoinfo.vue';
import goodslist from '../components/goods/goodslist.vue';
import goodsinfo from '../components/goods/goodsinfo.vue';
import goodsdesc from '../components/goods/goodsdesc.vue';
import goodscomment from '../components/goods/goodscomment.vue';
import car from '../components/shopcar/car.vue'
import '../../statics/mui/css/mui.css'
import moment from 'moment';
//定义一个日期格式化过滤器
Vue.filter('datefmt', (input, fmtstring) => {
    return moment(input).format(fmtstring);
});
var router1 = new VueRouter({
    linkActiveClass: 'mui-active',
    routes: [
        {path: '/', redirect: '/home'},
        {path: '/home', component: home},
        {path: '/shopcar', component: shopcar},
        {path: '/news/newslist', component: newslist},
        {path: '/news/newsinfo/:id', component: newsinfo},
        {path:'/photo/photolist',component:photolist},
        {path:'/photo/photoinfo/:id',component:photoinfo},
        {path:'/goods/goodslist',component:goodslist},
        {path:'/goods/goodsinfo/:id',component:goodsinfo},
        {path:'/goods/goodsdesc/:id',component:goodsdesc},
        {path:'/goods/goodscomment/:id',component:goodscomment},
        {path:'/shopcar/car',component:car}


    ]
});
import '../../statics/css/site.css';
import vueResource from 'vue-resource';

Vue.use(vueResource);
new Vue({
    el: '#app',
    router: router1,
    // render:function(create){create(App)} //es5的写法
    render: c => c(App)  // es6的函数写法 =>：goes to
});
